package com.lmk.t02;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

public class WriterTest {
    public static void main(String[] args) {
        String[]  lines={"股市有风险","入市需谨慎！"};
        String path="d:/11/d.txt";
        File file=new File(path);
        try(BufferedWriter bw=new BufferedWriter(new FileWriter(file))){
            for (String line:lines) {
                bw.write(line);
                bw.newLine();

            }
            bw.flush();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
